#import "sprite_dummy.h"

#define DUMMY_TOTAL_STRING_CONUT 29
#define DUMMY_STRING(string) [self CreateString : @string];

#define DUMMY_FONT_NAME @"ArialMT"
#define DUMMY_LINE_OFFSET 2.0f

#if (HARD_WARE == HARD_WARE_IPHONE)
	#define DUMMY_FONT_SIZE 16
#elif (HARD_WARE == HARD_WARE_IPAD)
	#define DUMMY_FONT_SIZE 24
#endif

@implementation SpriteDummy

- (id)initSpriteDummy:(bool)flagRandom
{
	int i;
	float _TotalY, _Y;

	if ((self = [super init]))
	{
		/*type
		*/
		if (flagRandom)
		{
			g_SpriteDummyType = rand() % DUMMY_TOTAL_STRING_CONUT;
		}

		/*create string
		*/
		switch (g_SpriteDummyType)
		{
		case 0:
			DUMMY_STRING("I miss you when I am depressed,");
			DUMMY_STRING("just as I miss the sunlight in winter;");
			DUMMY_STRING("I miss you when I feel happy,");
			DUMMY_STRING("just as I miss the shade in the hot sun.");
			break;
		case 1:
			DUMMY_STRING("I send my miss to the scattering stars");
			DUMMY_STRING("and");
			DUMMY_STRING("wish you a sweet dream");
			DUMMY_STRING("under the light shedding");
			DUMMY_STRING("through your window.");
			break;
		case 2:
			DUMMY_STRING("I want that my love to you");
			DUMMY_STRING("will turn into bright sunlight");
			DUMMY_STRING("so that to warm your heart.");
			break;
		case 3:
			DUMMY_STRING("I prefer having your accompanying");
			DUMMY_STRING("for life-long time to");
			DUMMY_STRING("the short-time tenderness.");
			break;
		case 4:
			DUMMY_STRING("If living on the earth");
			DUMMY_STRING("is a mission from the lord…");
			DUMMY_STRING("living with you is the award of the lord…");
			break;
		case 5:
			DUMMY_STRING("You know my loneliness is only kept for you,");
			DUMMY_STRING("my sweet songs are only sung for you.");
			break;
		case 6:
			DUMMY_STRING("My heart beats for you every day.");
			DUMMY_STRING("I am inspired by you every minute,");
			DUMMY_STRING("and I worry about you every second.");
			DUMMY_STRING("It is wonderful to have you in my life.");
			break;
		case 7:
			DUMMY_STRING("Coffee is lonely without cups.");
			DUMMY_STRING("I am lonely without you.");
			break;
		case 8:
			DUMMY_STRING("You and I remains the same in different time,");
			DUMMY_STRING("at different places,");
			DUMMY_STRING("among different people;");
			DUMMY_STRING("time is changing,");
			DUMMY_STRING("space is changing and");
			DUMMY_STRING("everything is changing ");
			DUMMY_STRING("except my miss to you!");
			break;
		case 9:
			DUMMY_STRING("As long as you are willing,");
			DUMMY_STRING("please let me know what I can do for you.");
			DUMMY_STRING("When you are unhappy and want to");
			DUMMY_STRING("cry on somebody’s shoulder,");
			DUMMY_STRING("I will stand before you immediately.");
			break;
		case 10:
			DUMMY_STRING("I can meet a person in a minute,");
			DUMMY_STRING("like a person in an hour ");
			DUMMY_STRING("and love a person in a day,");
			DUMMY_STRING("but it will take me a whole life to forget you.");
			break;
		case 11:
			DUMMY_STRING("I don’t know whether I really love you,");
			DUMMY_STRING("but I know I cannot lose you.");
			DUMMY_STRING("If the earth is going to be destroyed");
			DUMMY_STRING("I want to tell you that");
			DUMMY_STRING("you are the only one I want to see.");
			break;
		case 12:
			DUMMY_STRING("You are everything when you are with me,");
			DUMMY_STRING("and everything is you when you are not.");
			break;
		case 13:
			DUMMY_STRING("The moonlight stands for my heart!");
			break;
		case 14:
			DUMMY_STRING("Do you know");
			DUMMY_STRING("there is someone thinking of you and");
			DUMMY_STRING("caring you all the time?");
			DUMMY_STRING("Your smiling eyes are just like the");
			DUMMY_STRING("sparkling stars hanging");
			DUMMY_STRING("on the curtain of my heart.");
			break;
		case 15:
			DUMMY_STRING("Love never dies.");
			break;
		case 16:
			DUMMY_STRING("The soul cannot live without love.");
			break;
		case 17:
			DUMMY_STRING("我感到世界上的一切，");
			DUMMY_STRING("全部属于我了，");
			DUMMY_STRING("因为你爱上了我。");
			DUMMY_STRING("我不在乎世界有多大  多繁华");
			DUMMY_STRING("我在乎的  只是能在你身旁  你放我在心上");
			break;
		case 18:
			DUMMY_STRING("我要你知道，");
			DUMMY_STRING("这个世界上有一个人会永远等着你。");
			DUMMY_STRING("无论是在什么时候，");
			DUMMY_STRING("无论你在什么地方，");
			DUMMY_STRING("反正你知道总会有这样一个人。");
			DUMMY_STRING("--《半生缘》");
			break;
		case 19:
			DUMMY_STRING("Un día dejé caer una lágrima en el oceano.");
			DUMMY_STRING("El día que la encuentre será");
			DUMMY_STRING("el día que deje de quererte.");
			break;
		case 20:
			DUMMY_STRING("Si se pudiera medir el amor que por tí siento,");
			DUMMY_STRING("te juro que llegaría más allá del firmamento.");
			break;
		case 21:
			DUMMY_STRING("Als ich Dich das erste Mal sah,");
			DUMMY_STRING("wusste ich dass Du eine ganz besondere");
			DUMMY_STRING("Rolle in meinem Leben spielen würdest.");
			break;
		case 22:
			DUMMY_STRING("Nur mit dir ist mein leben Komplett~~");
			break;
		case 23:
			DUMMY_STRING("あなたがいなくては生きていけない。");
			break;
		case 24:
			DUMMY_STRING("遠く離れていても、");
			DUMMY_STRING("あなたの気持ちは、");
			DUMMY_STRING("手に取るように分かります");
			break;
		case 25:
			DUMMY_STRING("約束するよ");
			break;
		case 26:
			DUMMY_STRING("내가 이세상에서,");
			DUMMY_STRING("사랑하는,");
			DUMMY_STRING("사람은 오직,");
			DUMMY_STRING("너 하나 뿐이야");
			break;
		case 27:
			DUMMY_STRING("넌 하늘이 내게 준,");
			DUMMY_STRING("소중한 보물이야,");
			DUMMY_STRING("사랑해");
			break;
		case 28:
			DUMMY_STRING("사랑해요,");
			DUMMY_STRING("늘 지금처럼,");
			DUMMY_STRING("는 처음처럼,");
			DUMMY_STRING("늘 당신과 함께  하고 싶어요");
			break;
		default:;
		}

		/*position
		*/
		_TotalY = textTable_.size() * textTable_[0].contentSizeInPixels.height + (DUMMY_TOTAL_STRING_CONUT - 1) * DUMMY_LINE_OFFSET;
		_Y = _TotalY / 2.0f;
		for (i = 0; i < textTable_.size(); i++)
		{
			textTable_[i].positionInPixels = ccp(0.0f, _Y);
			_Y -= textTable_[0].contentSizeInPixels.height + DUMMY_LINE_OFFSET;
		}
	}
	return self;
}

- (void)CreateString:(NSString *)String
{
	CCLabelTTF *_Label;

	_Label = [CCLabelTTF labelWithString:String fontName:DUMMY_FONT_NAME fontSize:DUMMY_FONT_SIZE];
	[self addChild:_Label];
	_Label.anchorPoint = ccp(0.5f, 1.0f);
	textTable_.push_back(_Label);
}

@end